$(function(){
	//header
	//移入 我的E宠 时显示下拉菜单
	$(".active1").mouseover(function(){
		$(".mypet").css("display","block");
		$(".active1 img").css({"transform":"rotate(270deg)","transition":"all .1s"});
	});   
	$(".active1").mouseout(function(){
		$(".mypet").css("display","none");
		$(".active1 img").css({"transform":"rotate(90deg)","transition":"all .1s"});
	});
	$(".mypet").mouseover(function(){
		$(".mypet").css("display","block");
		$(".active1 img").css({"transform":"rotate(270deg)","transition":"all .1s"});
	}); 
	$(".mypet").mouseout(function(){
		$(".mypet").css("display","none");
		$(".active1 img").css({"transform":"rotate(90deg)","transition":"all .1s"});
	});	
	//移入 收藏我 时显示下拉菜单
	$(".active2").mouseover(function(){
		$(".collect").css("display","block");
		$(".active2 img").css({"transform":"rotate(270deg)","transition":"all .1s"});
	});
	$(".active2").mouseout(function(){
		$(".collect").css("display","none");
		$(".active2 img").css({"transform":"rotate(90deg)","transition":"all .1s"});
	});
	$(".collect").mouseover(function(){
		$(".collect").css("display","block");
		$(".active2 img").css({"transform":"rotate(270deg)","transition":"all .1s"});
	}); 
	$(".collect").mouseout(function(){
		$(".collect").css("display","none");
		$(".active2 img").css({"transform":"rotate(90deg)","transition":"all .1s"});
	});	
	//移入 商品分类 时箭头转动

//	轮播图
	var mySwiper1 = new Swiper ('.banner_container', {
		autoplay : 1000,
		loop: true,
		// 如果需要分页器
		pagination: '.swiper-pagination',
		paginationClickable: true,
		onSlideChangeStart:function(swiper){
			var currentColor = $(swiper.slides[swiper.activeIndex]).attr("data-color");
			$(".banner_l").css("backgroundColor",currentColor);
			$(".currentTab").css("backgroundColor",currentColor);
			$(".active4").off().on("mouseover",function(){
				$(".active4,.active3").removeClass("currentTab").css("backgroundColor","");
				$(".active4").addClass("currentTab").css("backgroundColor",currentColor);
				$(".active4 img").css({"transform":"rotate(180deg) translateX(-5px)","transition":"all .1s"});
				$(".list10,.part").css("display","block");
				$(".cat").css("display","none");
			}).on("mouseout",function(){
				$(".active4 img").css({"transform":"rotate(0) translateX(0)","transition":"all .1s"});
			});
			$(".active3").off().on("mouseover",function(){
				$(".active4,.active3").removeClass("currentTab").css("backgroundColor","");
				$(".active3").addClass("currentTab").css("backgroundColor",currentColor);
				$(".active3 img").css({"transform":"rotate(180deg)","transition":"all .1s"});
				$(".list10,.part").css("display","none");
				$(".cat").css("display","block");
			}).on("mouseout",function(){
				$(".active3 img").css({"transform":"rotate(0)","transition":"all .1s"});
			});

		},
		paginationBulletRender: function (swiper, index, className) {
			return '<span class="' + className + '">' + (index + 1) + '</span>';
		}
	})
	//热门与进口猫粮的切换
	$(".staple_tit_list .active").mouseover(function(){
		$(".staple_r").css("display","block");
		$(".staple_r2").css("display","none");
	})
	//	.staple_tit_list .active:hover .staple_r{
	//	display: block;
	//}
	//.staple_tit_list .active:hover .staple_r2{
	//	display: block;
	//}

	//疯狂抢购轮播
	//$(".jiantou_r").click(function(){
	//	$(".littlePic").animate({"left":"50px"});
	//})

	//品牌街的轮播图(未完成)
	//var mySwiper_brand = new Swiper ('.swiper-container_brand', {
	//	autoplay : 1000,
	//	loop: true,
    //
	//	// 如果需要分页器
	//	pagination: '.swiper-pagination_brand',
    //
	//	// 如果需要前进后退按钮
	//	nextButton: '.swiper-button-next_brand',
	//	prevButton: '.swiper-button-prev_brand',
	//})

	//猫咪主粮列表移入移出效果
	$('.staple_tit_list li').mouseover(function(){
		$('.staple_tit_list li').removeClass("active");
		$(this).addClass("active");
	});
	//$(".staple_tit_list li").each(function(index,value){
	//	$(this).mouseover(function(){
	//		$(this).css({"border-top":"2px solid #e74085","border-left":"1px solid #e74085","border-right":"1px solid #e74085",
	//		"background": "white","border-bottom":"1px solid white","top":"-1px"});
	//		$(this).find("a").css({"color":" #e74085","border":"none"})
	//	});
	//	$(this).mouseout(function(){
	//		$(this).siblings().css({"border":"none","background":"","top":"0"});
	//		$(this).siblings().find("a").css({"color":"#666","border-right":"1px solid #ddd"});
	//	})
	//})
	//$(".orijen img").animate({"top":"3px"},100);

	//猫咪零食列表的移入移出效果
	$('.snacks_tit_list li').mouseover(function(){
		$('.snacks_tit_list li').removeClass("active");
		$(this).addClass("active");
	});
	//$(".snacks_tit_list li").each(function(index,value){
	//	$(this).mouseover(function(){
	//		$(this).css({"border-top":"2px solid #e74085","border-left":"1px solid #e74085","border-right":"1px solid #e74085",
	//			"background": "white","border-bottom":"1px solid white","top":"-1px"});
	//		$(this).find("a").css({"color":" #e74085","border":"none"})
	//	});
	//	$(this).mouseout(function(){
	//		$(this).siblings().css({"border":"none","background":"","top":"0"});
	//		$(this).siblings().find("a").css({"color":"#666","border-right":"1px solid #ddd"});
	//	})

	//猫咪保健的列表的移入移出效果
		$('.health_tit_list li').mouseover(function(){
			$('.health_tit_list li').removeClass("active");
			$(this).addClass("active");
		});
	//$(".health_tit_list li").each(function(index,value){
	//	$(this).mouseover(function(){
	//		$(this).css({"border-top":"2px solid #e74085","border-left":"1px solid #e74085","border-right":"1px solid #e74085",
	//			"background": "white","border-bottom":"1px solid white","top":"-1px"});
	//		$(this).find("a").css({"color":" #e74085","border":"none"})
	//	});
	//	$(this).mouseout(function(){
	//		$(this).siblings().css({"border":"none","background":"","top":"0"});
	//		$(this).siblings().find("a").css({"color":"#666","border-right":"1px solid #ddd"});
	//	})

	//猫咪日常的列表的移入移出效果
	$('.daily_tit_list li').mouseover(function(){
		$('.daily_tit_list li').removeClass("active");
		$(this).addClass("active");
	});
	//$(".daily_tit_list li").each(function(index,value){
	//	$(this).mouseover(function(){
	//		$(this).css({"border-top":"2px solid #e74085","border-left":"1px solid #e74085","border-right":"1px solid #e74085",
	//			"background": "white","border-bottom":"1px solid white","top":"-1px"});
	//		$(this).find("a").css({"color":" #e74085","border":"none"})
	//	});
	//	$(this).mouseout(function(){
	//		$(this).siblings().css({"border":"none","background":"","top":"0"});
	//		$(this).siblings().find("a").css({"color":"#666","border-right":"1px solid #ddd"});
	//	})
	//})
	//猫咪香波的列表的移入移出效果
	$('.shampoo_tit_list li').mouseover(function(){
		$('.shampoo_tit_list li').removeClass("active");
		$(this).addClass("active");
	});
	//$(".shampoo_tit_list li").each(function(index,value){
	//	$(this).mouseover(function(){
	//		$(this).css({"border-top":"2px solid #e74085","border-left":"1px solid #e74085","border-right":"1px solid #e74085",
	//			"background": "white","border-bottom":"1px solid white","top":"-1px"});
	//		$(this).find("a").css({"color":" #e74085","border":"none"})
	//	});
	//	$(this).mouseout(function(){
	//		$(this).siblings().css({"border":"none","background":"","top":"0"});
	//		$(this).siblings().find("a").css({"color":"#666","border-right":"1px solid #ddd"});
	//	})
	//})
	//猫咪玩具的列表的移入移出效果
	$('.toy_tit_list li').mouseover(function(){
		$('.toy_tit_list li').removeClass("active");
		$(this).addClass("active");
		//$(this).find("a").css({"color":" #e74085","border":"none"});
	});
	//$(".toy_tit_list li").each(function(index,value){
	//	$(this).mouseover(function(){
	//		$(this).css({"border-top":"2px solid #e74085","border-left":"1px solid #e74085","border-right":"1px solid #e74085",
	//			"background": "white","border-bottom":"1px solid white","top":"-1px"});
	//		$(this).find("a").css({"color":" #e74085","border":"none"})
	//	});
	//	$(this).mouseout(function(){
	//		$(this).siblings().css({"border":"none","background":"","top":"0"});
	//		$(this).siblings().find("a").css({"color":"#666","border-right":"1px solid #ddd"});
	//	})
	//});
	//footer
	//$(".footer_main li").mouseenter(function(){
	//	$(this).animate({"top":"-5px"},1000);
	//});
	//回顶部
	var a=document.getElementById("wrap_r_block7");
		a.onclick = function(){
				document.documentElement.scrollTop = 0;
				document.body.scrollTop = 0;
		};

//	首页轮播
	var mySwiper01 = new Swiper ('.myswiper01', {
		slidesPerView : 4,
		nextButton: '.swiper-button-next',
		prevButton: '.swiper-button-prev',
	});
	//品牌街的轮播
	var myswiper02 = new Swiper ('.mySwiper02', {
		autoplay:3000,
		// 如果需要分页器
		pagination: '.swiper-pagination',
	});
	//E宠头条轮播图
	var myswiper03 = new Swiper ('.mySwiper03', {
		autoplay:2000,
		direction : 'vertical',
		slidesPerView : 2,
	});
	//E宠口碑的左边轮播图
	var myswiper04 = new Swiper ('.mySwiper04', {
		autoplay:2000,
		// 如果需要分页器
		pagination: '.swiper-pagination',
	});
	//TA公益下面部分的轮播
	var myswiper05 = new Swiper ('.mySwiper05', {
		autoplay:1000,
		direction : 'vertical',
	});
});
